/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: yang
 * Date: 2022-05-30
 * Time: 15:29
 */
public class User {
    private String username;
    private String password;

    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }

    void login(String username, String password) throws PasswordException,UsernameException{
        if(!this.username.equals(username)){
            throw new UsernameException("用户名错误");
        }
        if(!this.password.equals(password)){
            throw new PasswordException("密码错误");
        }
    }
}
